<?php


error_reporting( E_ALL ); // -1
ini_set( 'display_errors', true ); // false
ini_set( 'log_errors', true );
ini_set( 'error_log', 'errors.log' );

// Engine config
include "engine/library/start_engine.inc";

// Base files
include _LIBRARY."quick.inc";

// classes
include_class("phenol", "local", "ini", "log", "helper",
				"template", "page", "module", "dbdriver", "dbase");

// Загрузка конфигурации сайта
loadBaseConfig();


// Обработчики ошибок
set_error_handler("errorsHandler");
assert_options(ASSERT_CALLBACK, 'assertHandler');


$site = new Phenol();

if ( ! $site->db->driver_load( $_baseConfig->get("DataBase", "driver") ) )
{
	$site->db->driver_load( "mysql" );
}

$site->session_settings_load();

$site->module_search();
$site->module_autoconnect(DEFAULT_MODULE);
$site->module_action_fire();

$site->dispatch();